import request from '@/utils/request';

/**
 * 获取行政机构
 */
export async function fetchCompany(data) {
    return request('/api/uc/org/ads/v1/orgLinkList', {
        method: 'POST',
        data
    });
}

/**
 * 获取组织机构
 */
export async function fetchOrg(data) {
    return request('/api/uc/org/functional/v1/orgLinkList', {
        method: 'POST',
        data
    });
}

/**
 * 获取组织机构及下属机构下的所有员工
 */
export async function fetchOrgEmployee(organizationCode) {
    return request(`/api/org/v1/functional/employeeInfo/treeAdmin/${organizationCode}`, {
        method: 'GET'
    });
}

// 获取授权树数据
export async function fetchDutyListByOrganization(params) {
    return request('/api/org/v1/duty/queryDutyListByOrganization', {
        method: 'POST',
        data: params
    });
}
